Pattern defect inspection method and apparatus

ABSTRACT

The pattern defect inspection apparatus is operable to detect defects by comparing a detection image, which is obtained through scanning by an image sensor those patterns that have the identical shape and are continuously disposed on the object under tested at equal intervals in row and column directions, with a reference image obtained by scanning neighboring identical shape patterns in the row and column directions. This apparatus has a unit for generating an average reference image by statistical computation processing from the images of identical shape patterns lying next to the detection image including at least eight nearest chips on the up-and-down and right-and-left sides and at diagonal positions with the detection image being intermediately situated. The apparatus also includes a unit that detects a defect by comparing the detection image to the average reference image thus generated.

FIELD OF THE INVENTION

The present invention relates to a method and apparatus for performingdefect inspection while detecting the images of a plurality of patternsas formed on or above an object to be tested, such as a semiconductorwafer, photo-mask, printed circuit board or equivalents thereto.

BACKGROUND OF THE INVENTION

Typically in pattern defect inspection procedures, a one-dimensional(1D) or linear image sensor is used as the image detection means forpicking up the image of an object to be tested. FIG. 4 is a diagramshowing an arrangement of such image sensor 8, and FIG. 5 is a plan viewof an inspection area of the object being tested, for indicating thearea that is image-detectable by a single time of scanning. Scan theobject under test in a direction at right angles to the layout directionof picture elements or “pixels” 81 of the image sensor 8, therebyacquiring a two-dimensional (2D) image. The length of the directionalong which the pixels 81 are queued is called the “height” of the imagesensor 8. In addition, in case the object under test is assumed to be asemiconductor wafer having a plurality of semiconductor chips beingpresently fabricated, the length of a single chip in the same directionas the height of image sensor 8 is called the chip height. Generally thechip height is larger than the height of image sensor 8, so it is merelypossible to detect only an image of part of the chip through one-timescanning of the image sensor 8. The significance of this chip's partialimage is determinable depending upon the height of the image sensor 8that performs detection and the imaging magnification of an imagefocussing optical system for projecting the chip image onto this imagesensor 8. This height is called the effective image pickup height of theimage sensor 8. In a combination of a currently used image sensor andits associated image focusing optical system, the effective image pickupheight is less than the chip height. Accordingly, in order to inspect anoverall chip surface, a method is employed for scanning it whileoffsetting in the height direction for multiple times.

FIG. 6 is a plan view diagram showing a sensor scan locus 101 in case aplurality of chips 21 that are formed on a wafer are scanned by an imagesensor for several times. Usually in the pattern defect inspectionapparatus, the image sensor is fixed while using a stage to move thewafer under test. Firstly, let the test object move in the X direction;then, acquire an image. Information per pixel of one chip 21 is storedin a memory in the order of scanning. After having completed the imagedetection in a one-time scan cycle, let the test object move in the Ydirection by a distance corresponding to the effective image pickupheight of the image sensor. The stage is driven to shift in position asindicated by broken line in FIG. 6 so that the scan direction becomesreversed. This will be repeated to thereby achieve sequential imagedetection.

While inspection of the chip 21 is performed by image comparison of thesame patterns, the image of a test area “c” is used as a reference imagein the case of testing an area “b.” However, when testing an area “a”that is the forehand chip of each row to be scanned, it is impossible toperform any intended inspection due to the absence of a reference imagein an area immediately preceding the same pattern. This would result ingeneration of noninspectable areas or regions in the outer periphery ofthe wafer. For this reason, non-inspectable chips would take place inthose in the wafer outer periphery.

In prior known pattern defect inspecting apparatus, there is the onethat solved the above-noted problem by modifying the scan method (forexample, see JP-A-11-160247). FIG. 7 is a plan view showing the scanninglocus of an image sensor in a similar way to FIG. 6. In this case, theeffective image pickup height of the image sensor is one-third (⅓) ofthe chip height. Assume that scanning is done while dividing the testarea into three strip-like regions. Although the scanning of the firstrow in the X direction is the same as that shown in FIG. 6, the secondrow is scanned while causing an object under test to move by a distancecorresponding to the height of one chip in the Y direction. This will berepeated for execution of comparative inspection of the images ofidentical patterns each having its region equal in size to ⅓ of a chip.Upon completion of the last row, as indicated by dotted line in FIG. 6,the image of the same pattern in the next ⅓ regions of the chip issubjected to comparison inspection. After having finished the firstchip, comparison inspection is done for the image of the same pattern inthe remaining ⅓ region of the chip.

In the case of testing of an area “b” which is immediately after afold-back or a halfway point, the pixel information of the area “c” foruse as a reference image is read out in an order reverse to the order atthe time of data storage, whereby the comparison inspection isexecutable while letting the area b and area c be the same patternimage. Optionally, the image of another area of the same pattern may beprestored as the reference image of the area a upon startup of theinspection. Whereby, it is possible to perform the inspection of thearea a also.

However, in any one of the pattern defect inspection apparatus forperforming inspection based on the scan locus shown in FIG. 6 and thepattern defect inspection apparatus for performing inspection relyingupon the scan locus shown in FIG. 7, comparative inspection of thedetection image of a chip is performed by comparing it to the referenceimage of its immediately preceding chip with the same pattern. Using theimage of such immediately preceding chip in this way raises problemswhich follow.

An object under test for use as the object being subjected to patterndefect inspection is such that a pattern is typically formed of amaterial that is transparent with respect to the wavelength of visiblelight, such as a photo-resist or a dielectric film made of SiO₂ or thelike. In this case, even if a thin film is transparent relative to thewavelength of light being used in the defect inspection apparatus, itexhibits certain reflectivity which is determinable by such the lightwavelength and the refractivity of a material making up the pattern plusa film thickness. This makes it possible for the defect inspectionapparatus to detect its presence as a light-and-shade image. FIG. 1shows an exemplary wafer having a pattern of thin film formed thereon,which is made of a material transparent to the wavelength of light beingused in the defect inspection apparatus. Generally in such the wafer,the thickness of the thin film pattern is not perfectly flat on anentire wafer surface but slightly different depending on locations;however, a certain degree of film thickness error is made acceptablebecause such error does not affect the manufacture of semiconductorchips. Unfortunately, a difference in film thickness occurring dependingon locations can create a likewise difference in reflectivity of thepattern, resulting in occurrence of an appreciable difference inbrightness or luminance of an image to be detected. This phenomenon iscalled the color shading irregularity. For example, suppose that aneighboring chip “n” and its immediately preceding chip n−1 of FIG. 1are such that the same shaped patterns “p” included therein aredifferent in film thickness from each other, resulting in occurrence ofcolor shading. In this case, if the comparison inspection is carried outwhile letting the chip n be a detection image and also regarding thechip n−1 as a reference image, then the pattern p must be erroneouslydetected as a defect. This occurs because the resultant image isdifferent in light-and-shape property even though the pattern p is thesame in shape between these two images and no defects are presenttherein. Such the false defect information raises difficulties indistinction from a true defect and thus is a serious problem relating tothe reliability of the inspection apparatus.

Prior known approaches to avoiding the above-noted false defectinformation include two methods which follow:

(1) increasing the threshold value so that the color shadingirregularity is insensitive to test results during inspection whilecomparing a detection image to reference image, wherein the thresholdvalue becomes a criterion for judgment of which degree of difference isregarded as a dominant difference; and

(2) correcting or amending the influenceability of color shadingirregularity occurring between the detection image and reference imageand then performing comparison inspection after removal of the colorshading.

The advantage of the method (1) does not come without accompanying thefollowing penalties: the inspection apparatus decreases in detectionsensitivity; and, its detection ability or “detectability” for truedefects decreases simultaneously. Regarding the method (2), this is amethod such as shown in JP-A-2000-97869 for example. Estimation of thedegree of the color shading at a chip position of the detection imagefrom the reference image of its immediately preceding chip is equivalentin principle to estimating by interpolation unknown information in thefuture from known information in the past. In addition, utilizableinformation items are as less as two images i.e., a single plane ofdetection image and a reference image plane. Thus, this method isdisadvantageously limited in effects for enabling correction and removalof the color shading influenceability.

A pattern inspection apparatus is disclosed in JP-A-10-74812, whichapparatus detects an image signal from a repeated pattern to be tested,and generates from this detected image signal a statistical image signalof the repeated pattern being tested, and then uses this generatedstatistical image signal as a reference image signal to compare it tothe above-noted detected image signal while applying thereto positionalignment, thereby extracting a defect or a defect candidate that ispresent in the pattern under test.

JP-A-3-286383 discloses therein a surface defect inspecting apparatusfor detecting defects based on a pattern difference. This apparatuscomprises means for sequentially accepting first patterns, patterngenerator means for calculating an average value of the first patternsaccepted by the accepting means to thereby generate a second pattern,and means for comparing the second pattern thus generated to a newlyaccepted first pattern and for detecting a pattern difference, if any.

JP-A-5-218160 discloses a semiconductor chip appearance inspectionapparatus which includes a first image memory that sequentiallytemporarily stores dark-and-light grayscale information of a pluralityof semiconductor chips obtained by dicing a single piece of wafer, asecond image memory for storing reference grayscale information used forexecution of comparative judgment by comparison with the grayscaleinformation of the first image memory, a defect-free product detectorunit for comparing the grayscale information of the first image memoryto that of the second image memory to thereby detect non-defectivesemiconductor chip products, and an image averaging processor unit forperforming, when the defect-free product detector unit judges a chip asa good product, computation of the grayscale information of the firstand second image memories, for rewriting the grayscale information ofthe second image memory based on the computation result, and forallowing the rewritten information to become a new reference grayscaleinformation.

SUMMARY OF THE INVENTION

An object of this invention is to provide a pattern defect inspectionapparatus capable of improving the accuracy of pattern defect inspectioneven when a pattern which is formed of a transparent thin film isdifferent in thickness between the position of a detection image and theposition of a reference image. Another object of the invention is toprovide a pattern defect inspection method with such the capability.

To attain the foregoing objects, the invention employs a technique forgenerating an average reference image from the images of a plurality ofmore than two patterns of identical shape—these include forth and backones lying relatively near to a detection image with at least thedetection image being interposed therebetween of those patterns havingthe same shape as continuously laid out on an object being tested atequal intervals in row and column directions.

To do this, the invention comprises a means for storing therein adetection image and the images of a plurality of more than two identicalshape patterns containing the forth and back ones lying next to thedetection image with at least the detection image interposedtherebetween, an average reference image generator means for generatingfrom such the stored images an average reference image throughstatistical computation processing, and an image comparator means forperforming comparison inspection of the detection image and the averagereference image to thereby detect defects, if any.

A feature of the invention lies in creation of the average referenceimage by statistical computation processing from four identical shapepatterns on the up-down and right-left sides of the detection image,with two further patterns in the up-down directions being added thereto.

With this arrangement, it is possible, by generating the reference imagefrom at least four up-down and right-left images with the detectionimage interposed therebetween, to obtain the intended reference imagewhich approximates the color shading irregularity at the detection imageposition. Thus it is possible to effectively suppress color shadinginfluenceabilities during comparison testing of this reference image andthe detection image. This in turn makes it possible to provide thepattern defect inspection method and apparatus capable of improving theaccuracy of pattern defect inspection even for an object under test thatis relatively large in color shading influenceability.

According to the invention, it is possible to achieve an improvedpattern defect inspection apparatus capable of removing or suppressingthe color shading influenceability to thereby detect defects with highinspection accuracy even in cases where a pattern is formed of atransparent thin film on or above the object under test with thetransparent thin film being variable in thickness depending uponlocations overlying the object under test.

A pattern defect inspection apparatus of the present invention is theone that detects defects by comparing a detection image, which isobtainable by scanning using an image sensor those patterns having thesame shape as continuously laid out on an object to be tested at equalintervals in row and column directions, to a reference image obtained byscanning such the identically shaped patterns residing side-by-side inthe row and column directions. This apparatus is characterized bycomprising means for generating an average reference image throughstatistical computation processing from the images of identical shapepatterns residing next to a detection image, including eight nearestchips that neighbor the detection image on up-down and right-left sidesand at oblique or diagonal positions with the detection image interposedtherebetween, and means for comparing the detection image to thegenerated average reference image to thereby detect defects, if any.

In accordance with this arrangement, the reference image is generatedfrom at least the eight, up-down and right-left plus diagonallyneighboring nearest images with the detection image intermediatelysituated. Thus it becomes possible to obtain the reference image thatapproximates the color shading state at the detection image position sothat it is possible to effectively lighten the color shadinginfluenceability during comparison testing of this reference image andthe detection image. This makes it possible to provide the intendedpattern defect inspection method and apparatus capable of improving theaccuracy of pattern defect inspection even for those objects under testwith large color shading influenceability.

The statistical computation processing for generating the averagereference image includes the step of performing simple averaging of thepattern of the nearest same shapes which reside next to the detectionimage on its up-down and right-left sides and at diagonally neighboringlocations.

Alternatively the statistical computation processing for generating theaverage reference image includes performing calculation of an adaptablequadratic curved plane from eight nearest identical shape patterns whichlie relatively near to the detection image on the up-down and right-leftsides and also at diagonally neighboring positions.

A scheme for calculating the adapted quadratic curved plane is aleast-squares method. To this end, the apparatus includes a means forcalculating a mean square error at the same time during suchcalculation, means for using the mean square error to determine athreshold value for use during defect detection judgment, and means forjudging based on this threshold value the presence or absence of adefect(s).

Optionally the invention is configurable in the form of a pattern defectinspection apparatus for detecting defects by comparing a detectionimage obtainable through scanning, by an image sensor, patterns havingthe identical shape and being continuously laid out on an object to betested at equal intervals in row and column directions with a referenceimage obtained by scanning neighboring identical shape patterns in therow and column directions thereof, wherein the apparatus comprises meansfor generating an average reference image by statistical computationprocessing from both the detection image and the images of identicalshape patterns residing next to the detection image including at leasteight nearest chips on up-and-down and right-and-left sides and atdiagonally neighboring positions with at least the detection image beingintermediately situated, and means for detecting a defect by comparingthe detection image to the average reference image thus generated.

Other objects, features and advantages of the invention will becomeapparent from the following description of the embodiments of theinvention taken in conjunction with the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram showing a plan view of a wafer having its surface onwhich a pattern made of a transparent thin film is formed.

FIG. 2 is a plan view of a semiconductor wafer, along with an enlargedpartial view of it.

FIG. 3 is a diagram representing a quadratic curved plane thuscalculated.

FIG. 4 is a diagram showing the structure of an image sensor.

FIG. 5 is a plan view of an inspection area of an object to be tested.

FIG. 6 is a plan view showing a sensor scan locus in case a plurality ofchips are scanned by the image sensor for multiple times.

FIG. 7 is a plan view showing an image sensor scan locus.

FIG. 8 is a diagram schematically showing a configuration of a patterndefect inspection apparatus.

DETAILED DESCRIPTION OF THE EMBODIMENTS

One embodiment of the invention will be explained with reference to theaccompanying drawings.

FIG. 8 is a diagram schematically showing a configuration of patterndefect inspection apparatus. A wafer 3 that is an object to be tested isfixed onto a rotatable Zθ stage 2, which is movable in its heightdirection. The Zθ state 2 is situated on an X-Y stage 1 that isposition-slidable in an X direction that is the horizontal direction andalso in Y direction.

A half mirror 5 is located above the wafer 3, for directing illuminationlight from an illumination light source 4 toward the wafer 3 side tothereby illuminate the wafer 3 via an objective lens 6. Reflection lightas given off from a top surface of the wafer 6 is guided to pass throughthe objective lens 6 and half mirror 5 to reach an image sensor 8, whichreceives it as detection light. Additionally the light that was split bythe half mirror 7 enters an automatic focal point detector means 9,which calculates the optimum focussing position and then gives amovement instruction to a Z state of the Zθ stage 2, thereby enablingdetection of an image at the optimum focal point. The detection lightreceived by the image sensor 8 is passed through an analog-to-digital(A/D) converter 10 for conversion into a digital signal, which is thenstored or recorded in an image storage means 11.

As the chip height is generally greater than the effective image pickupheight of the image sensor 8, a process of testing an overall surface ofa chip 21 includes the steps of subdividing an area of chip 21 by theeffective image pickup height of the image sensor, and performing amultiplicity of scanning operations while shifting it in the heightdirection every time scan is done. An example is as follows. Supposethat the effective image pickup height of the image sensor is one-third(⅓) of the chip height. Also assume that the scanning is performed whiledividing the test area into three regions. If this is the case, thescanning procedure is as follows: as shown in FIG. 7, after havingperformed the first-time scanning in the X direction from its left toright, let the object under test move in the Y direction by a distancecorresponding to one chip height; then, perform a second scan operation.This will be executed iteratively to thereby perform comparisoninspection of an image of the same pattern equivalent to the chip's ⅓region. Upon completion of the last line, perform comparison inspectionof an image of the same pattern of the chip's next ⅓ region as indicatedby broken line in FIG. 7. When the first chip is ended, performcomparative inspection of an image of the same pattern of the chip'sremaining ⅓ region whereby the inspection of the entire surface area ofthe chip 21 is completed.

As will be described later, the embodiment of this invention is arrangedso that a reference image which is for use as an object being subjectedto comparison inspection with the detection image is created from theimages of eight nearest chips lying next to the chip of detection imageon its up-down and right-left sides plus at diagonally neighboringpositions. To this end, the above-noted image detector means 11 isrequired to have a capacity capable of storing all images correspondingto the effective image pickup height of the image sensor 8 with respectto a queue of three rows of chips. Note here that the term “right-left”refers to the front and rear or forth and back of the detection image inthe scan direction, whereas “up-down” should be interpreted as the upperand lower portions of the detection image when folded back while thescan direction is changed by the chip height. The language “diagonallyneighboring” is intended to mean four neighboring images on the“up-down” sides when folded back while changing the scan direction bythe chip height. Details are shown in FIG. 2. Assume that the waferunder test is 300 mm in diameter, the pixel size at the time ofinspection (size on the object under test) is set at 0.2 μm×0.2 μm, anda total number of pixels in the image sensor height direction is 4,096.Supposing that a 1 byte of memory space is required to store imageinformation per each pixel, the storage capacity required is given as:

300 mm÷0.2 μm×4,096×1 byte×3=approx. 17 gigabytes (GB),

(where, 1 GB=1,073,741,824 bytes).

Traditionally, this large capacity was achievable only by magneticrecording media of extremely low recording speeds, so it has beenconsidered unrealistic to realize such the technology in the patterndefect inspection apparatus that is required to perform processing on areal-time basis during inspection. Fortunately, recent advances insemiconductor device technologies make it possible to attain such degreeof storage capacity by use of an ensemble of semiconductor memories.

FIG. 2 is a plan view of a semiconductor wafer along with its enlargedpartial view. In the pattern defect inspection apparatus of thisembodiment, an image of a region adjacent to the test area is stored forlater use as the reference image. This reference image is compared to animage of the test area to thereby extract as a defect a differentportion between the both. On the single pierce of wafer 3 shown in FIG.2, a plurality of chips 21 are laid out, each of which becomes anindividual product. These chips 21 are continuously disposed, aspatterns of identical shape, at equal intervals in the row and columndirection. Here, an explanation will be given of an operation in thecase of detecting whether defects are present or absent in a test area“a” within a chip (m, n). Sequentially scan the wafer of an object undertest in the order of (n−1)th, n-th and (n+1)th rows. Upon completion ofthe scanning up to a chip in the (m+1)th column of the (n+1)th row, theresultant image is stored in the image storage means 11. At this time,the average reference image generator means 12 sequentially calculates asimple mean value (arithmetic average) of the signal intensity values ofcorresponding pixels of eight images of:

(m−1, n−1),

(m, n−1),

(m+1, n−1),

(m−1, n),

(m+1, n),

(m−1, n+1),

(m, n+1), and

(m+1, n+1),

thereby to produce an averaged reference image as the average of theseeight images. It should be noted that since respective chips of the(n−1)th and (n+1)th rows and each chip of n-th row are such that thestage's scan direction is reversed, read-out is performed in theopposite direction during reading of the stored image(s), therebyattaining equalization of the direction of image information.

Next, an image of chip (m, n) is read out as the detection image, whichis passed to the image comparator means 13 together with the above-notedaverage reference image. This image comparator means sequentiallyperforms comparison of the signal intensity values of pixelscorresponding to these two images. Thus, if a pixel is found to have adifference greater than a prespecified threshold value, then such pixelis detected as a defect.

In view of the fact that the average reference image created in thisembodiment is calculated from the eight nearest chips on the up-down andright-left sides and at diagonal positions with the chip of thedetection image being interposed therebetween, an image at a centralchip position is obtained by interpolation from the images of theseeight peripheral chips. Due to this, it is expectable that the status ofcolor shading irregularities to be contained in this average referenceimage is sufficiently proximate to the color shading state at the chipof the detection image residing at the center of these eight chips,except for a special case where the thickness of a transparent thin filmmaking up the pattern rapidly changes to exhibit appreciable incrementand decrement with respect to the chip layout interval. Generally, it isassumable that semiconductor wafers are such that the interval or layoutpitch of chips is less than or equal to 1/10 of the wafer diameter. Alsoassume that in those semiconductor wafers with film thickness errorsfalling into an allowable range, changes in thickness of thepattern-forming transparent thin film exhibit a simple increase ordecrease distribution within the chip interval. As apparent from theforegoing, it is possible for the defect inspection method of thisembodiment to obtain ultimate efficacy by simplified calculationprocessing, when compared to the methodology of estimating andcorrecting the degree of color shading irregularity at the chip positionof the detection image by using only the information of a total of twoimages of the detection image one surface and the reference image onesurface of its immediately preceding chip, as has been discussed in theintroductory part of the description for example, such as the oneindicated for example in JP-A-2000-97869.

Note here that although in the above embodiment the average referenceimage is obtained by calculation of the simple mean value (arithmeticaverage) of the eight nearest chips in the periphery of the detectionimage on a per-pixel basis, similar results are obtainable by a processhaving the steps of using a least-squares method to obtain, per eachpixel corresponding to one of these eight chip images, the bestadaptable quadratic curved plane:

g(x,y)=ax ² +by ² +cxy+dx+ey+f,  (Eq. 1)

then, identifying the value of g(x, y) at the chip position of acentrally located detection image, and next defining this value as thesignal intensity concerning the brightness or luminance of such pixel.More specifically, the statistical computation method for generating theaverage reference image includes calculating a quadratic curved planewith respect to the signal intensity of the luminance on eachcorresponding pixel of the eight nearest chip images, obtaining thesignal intensity on the quadratic curved plane corresponding to a pixelat the g(x, y) point of the detection image, and then comparing thisaveraged signal intensity to a signal at the above-noted g(x, y) point.FIG. 3 shows an example of such quadratic curved plane. Black dots asplotted herein represent the signal intensities at positions (x, y)within respective chip images. Eight points of black dots are used tocalculate the quadratic curved plane by statistical computation, therebyobtaining the signal intensity at a position corresponding to detectionon the quadratic curved plane thus calculated relative to the signalintensity at a position (x, y) within a detection chip image asindicated by a star sign or asterisk. Although an explanation as to itsintermediate calculation process is eliminated herein, this calculationresultingly becomes very simple. The signal value of each pixel of theaverage reference image may be calculated as:

-   -   Im, n=−0.25×Im−1, n+1+0.5×Im, n+1−0.25×Im+1, n+1+0.5×Im−1,        n+0.5×Im+1·n−0.25×Im−1, n−1+0.5×Im, n−1−0.25×Im+1, n−1        where, “Ip, q” denotes the signal value of the pixel of interest        at a chip (p, q). With this method, the calculation procedure        becomes somewhat complex when compared to the simple mean value        (arithmetic average); however, it offers an advantage as to an        ability to generate the average reference image with enhanced        accuracy even in cases where the film thickness rapidly changes        with respect to the chip interval.

Additionally in light of the fact that in this method using theleast-squares method, it is possible to simultaneously obtain the meansquare error (i.e., an expectation value of a square error between thequadratic curved plane thus obtained and the original sample data),there is another advantage. Typically even when comparing identicalshape patterns having no defects, calculation of an image differencedoes not always result in zero due to the presence of various kinds ofnoise components attempting to superposing image signals and/orfluctuation or else of micro-shapes that are too small to be categorizedas defects. For this reason, when judging whether defects are present orabsent, a need is felt to detect as defects only in case the imagedifference exceeds a fixed value that was preset as a threshold value.Unfortunately, determining the threshold value is such that appropriatesetup accompanies difficulties which follow: if it is too large, thenthe resultant sensitivity decreases unnecessarily; alternatively, if toosmall then noise components or the like are picked up even where nodefects are present in reality, resulting in unwanted production offalse defect information. This mean square error acts as a parameter orindex indicative of the exact degree of deviation owned by the identicalshape patterns contained in these eight chips even after correction ofthe color shading influenceability using this quadratic curved plane.Accordingly, when using this value to dynamically determine, duringtesting, the threshold value upon judgment of whether defects arepresent or absent, it is possible to determine the threshold value whileallowing it to reflect the actual variations. It is also possible toperform inspection while automatically increasing the threshold value atcertain locations large in noise components and pattern shapefluctuations and adversely automatically lowering the threshold value atthose locations less in such influenceability. Thus it becomes possibleto obtain an advantage as to the capability for effectively detectingdefects.

It should be further understood by those skilled in the art thatalthough the foregoing description has been made on embodiments of theinvention, the invention is not limited thereto and various changes andmodifications may be made without departing from the spirit of theinvention and the scope of the appended claims.

1-5. (canceled)
 6. A pattern defect inspection apparatus for detectingdefects by comparing a detection image obtainable through scanning by animage sensor patterns having an identical shape and being continuouslylaid out on an object to be tested at equal intervals in row and columndirections with a reference image obtained by scanning patterns of theidentical shape neighboring in the row and column directions thereof,said apparatus comprising: means for generating an average referenceimage by statistical computation processing from both the detectionimage and the identical shape patterns of at least eight nearest chipslying next to the detection image on up-down and right-left sides and atdiagonally neighboring positions with at least the detection image beingintermediately situated; and means for detecting a defect by comparingthe detection image to the average reference image thus generated.
 7. Apattern defect inspection method for detecting defects by comparing adetection image obtainable through scanning by an image sensor patternshaving an identical shape and being continuously laid out on an objectto be tested at equal intervals in row and column directions with areference image obtained by scanning patterns of the identical shapeneighboring in the row and column directions thereof, said methodcomprising the steps of: generating an average reference image bystatistical computation processing from images of identical shapepatterns lying next to the detection image including at least fournearest chips on up-and-down and right-and-left sides with the detectionimage being intermediately situated; and detecting a defect by comparingthe detection image to the average reference image thus generated.
 8. Apattern defect inspection method for detecting defects by comparing adetection image obtainable through scanning by an image sensor patternshaving an identical shape and being continuously laid out on an objectto be tested at equal intervals in row and column directions with areference image obtained by scanning patterns of the identical shapeneighboring in the row and column directions thereof, said methodcomprising: generating an average reference image by statisticalcomputation processing from images of identical shape patterns lyingnext to the detection image including at least eight nearest chips onup-and-down and right-and-left sides and at diagonally neighboringpositions with the detection image being intermediately situated; anddetecting a defect by comparing the detection image to the averagereference image thus generated.